from django.conf.urls import re_path
from . import views
from rest_framework.routers import SimpleRouter

urlpatterns = [
    # re_path(r'^labels/$',views.GetLabelsInfoView.as_view()),
    re_path(r'^labels/users/$',views.GetLabelsUserInfoView.as_view()),
    # '''最新问题'''
    re_path(r'^questions/(?P<pk>-1|\d+)/label/new/$',views.NewQuestionView.as_view()),
    # '''热门问题'''
    re_path(r'^questions/(?P<pk>-1|\d+)/label/hot/$',views.HotQuestionView.as_view()),
    # '''等待回答问题'''
    re_path(r'^questions/(?P<pk>-1|\d+)/label/wait/$',views.WaitQuestionView.as_view()),
    #'''问题详情'''
    re_path(r'^questions/(?P<pk>\d+)/$', views.ObtainDetailQuestionView.as_view()),
    #'''回答问题'''
    re_path(r'^reply/$', views.ReplyQuestionView.as_view()),
    # '''关注标签'''
    # re_path(r'^labels/(?P<pk>\d+)/focusin/$', views.FocusinLabelView.as_view()),

]

router = SimpleRouter()
# ‘’‘发布问题’‘’
router.register('questions',views.PublishQuestionView,basename='questions')
# ‘’‘问题有用/没用’‘’
router.register('questions',views.UsefulQuestionView,basename='useful')
# ‘’‘回答有用/没用’‘’
router.register('reply',views.UsefulReplyView,basename='useful')
# '''label'''
router.register('labels',views.GetLabelsInfoView,basename='label')
# '''Detailed label'''
router.register('labels',views.GetDetailedLabelsInfoView,basename='label')
# '''focusin/focusout'''
router.register('labels',views.FocusLabelView,basename='focus')

urlpatterns += router.urls